requirejs.config({
    baseUrl: './js/',
    paths: {
        module2: 'module2'
    }
});

requirejs(['module2'],
    function (module2) {
        console.log('module2.name', module2.getName)
    });